Skip to content

Cache token info in Wallbox#154147

Merged
joostlek merged 9 commits into
home-assistant:devfrom
hesselonline:wallbox_validation_changes
Nov 20, 2025
Merged

Cache token info in Wallbox#154147
joostlek merged 9 commits into
home-assistant:devfrom
hesselonline:wallbox_validation_changes

Conversation

@hesselonline
Copy link
Copy Markdown
Contributor

Proposed change

This PR removes some validation in the config flow, in order to prevent 429 errors (too many requests) from the API side. Previously we did an authentication check to ensure that the credentials were valid, to prevent triggering a 429 these validation steps have been removed.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Comment thread homeassistant/components/wallbox/config_flow.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft October 10, 2025 13:40
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@hesselonline hesselonline marked this pull request as ready for review October 12, 2025 09:26
@home-assistant home-assistant Bot requested a review from joostlek October 12, 2025 09:26
@hesselonline
Copy link
Copy Markdown
Contributor Author

@joostlek I'm now also checking the validity of the token during the authenticate and updating it if changed. This way we always have an up-to-date token in the entry.options for reuse after a restart. In order to do so I had to change the authenticate method to being async (in order to update entry.options).

Copy link
Copy Markdown
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume the config flow tests should also be adapted

Comment thread homeassistant/components/wallbox/config_flow.py Outdated
Comment thread homeassistant/components/wallbox/coordinator.py Outdated
Comment thread homeassistant/components/wallbox/coordinator.py
@home-assistant home-assistant Bot marked this pull request as draft October 14, 2025 10:28
@hesselonline hesselonline marked this pull request as ready for review October 15, 2025 08:08
@home-assistant home-assistant Bot requested a review from joostlek October 15, 2025 08:08
@hesselonline
Copy link
Copy Markdown
Contributor Author

@joostlek, small bump here. The issue is still open so I think this fix is highly anticipated ;-)

Comment thread homeassistant/components/wallbox/__init__.py Outdated
@joostlek joostlek added this to the 2025.11.3 milestone Nov 20, 2025
@joostlek joostlek changed the title remove validation to prevent 429 error Cache token info in Wallbox Nov 20, 2025
@joostlek joostlek merged commit 25e2c9e into home-assistant:dev Nov 20, 2025
32 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants